<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="获取DOM中元素"  @click="getDOMInfo">
        <input type="button" value="获取组件"  @click="getComInfo">
        <h3 id="myh3" ref="myh3">哈哈,我是最帅的啦</h3>
        <mycom1 ref="mycom1"></mycom1>

    </div>
    <script>
        var mycom1 = {
            template : '<h2>璇璇是真的傻</h2>',
            data() {
                return {
                    msg : '不想吼她'
                }
            },
            methods: {
                test(){
                    console.log('该怎么办咯')
                    
                }
            },
        }

        new Vue({
            el : '#app',
            data : {

            },
            methods : {
                getDOMInfo(){
                    console.log(this.$refs.myh3)
                    
                },
                getComInfo(){
                    console.log(this.$refs.mycom1)
                }
            },
            components : {
                mycom1
            }
        })
    
    </script>
</body>
</html>